﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SingletonUnit
{

    public sealed class DoubleCheckedLockingSingleton : BaseSingleton
    {
        private static DoubleCheckedLockingSingleton _instance = null;
        private static readonly object SyObject = new object();
        private DoubleCheckedLockingSingleton() { }
        public static DoubleCheckedLockingSingleton Instance
        {
            get
            {
                if (null != _instance) { return _instance; }
                lock (SyObject)
                {
                    return _instance ?? (_instance = new DoubleCheckedLockingSingleton());
                }
            }
        }
    }
}